﻿using IntelligentAgriculture.Contracts.Interface;
using IntelligentAgriculture.Domain.Entity;
using IntelligentAgriculture.WebAPI.Application.Command.DescendanttransferCommand;
using MediatR;

namespace IntelligentAgriculture.WebAPI.Application.CommandHandler.DescendanttransferCommandHandler
{
	/// <summary>
	/// 反填后裔转种
	/// </summary>
	/// <returns></returns>
	public class DetaileDescendanttransferCommandHandler : IRequestHandler<DetaileDescendanttransferCommand, Descendanttransfer>
	{
		/// <summary>
		/// 接口
		/// </summary>
		private readonly IDescendantTransferService _descendantTransferService;
		/// <summary>
		/// 构造函数
		/// </summary>
		/// <param name="descendantTransferService"></param>

		public DetaileDescendanttransferCommandHandler(IDescendantTransferService descendantTransferService)
		{
			_descendantTransferService = descendantTransferService;
		}
		public async Task<Descendanttransfer> Handle(DetaileDescendanttransferCommand request, CancellationToken cancellationToken)
		{
			var result= await _descendantTransferService.DetaileDescendanttransfer(request.eartag);
			return result;
		}
	}
}
